﻿namespace PreGUI.Widgets
{
    using PreGUI.Interfaces;
    using UnityEngine;
    using UnityEngine.UI;
    using PreGUI.Helpers;

    /// <summary>
    /// PreGui Button Control
    /// </summary>
    [RequireComponent(typeof(PGCursorListener))]
    public class PGCheckBox : IPGControl
    {
        public GameObject LayoutControls(PreGui gui, GameObject parent, string windowName)
        {
            var gameObject = new GameObject("PGButton");
            gameObject.transform.SetParent(parent.transform);

            var cursorListener = gameObject.GetComponent<PGCursorListener>();
            cursorListener.Gui = gui;
            cursorListener.CursorStyle = eCursorMode.Pointer;



            var toggleComponent = gameObject.AddComponent<Toggle>();


            return gameObject;
        }

        public IPGControl GenerateFromXmlNode(System.Xml.XmlNode node)
        {

            return this;
        }
    }
}
